<div id="mid_container">
	<script>
		last_tab = 'tab1';
		function show(layerName) {
			document.getElementById(layerName).style.display = '';
		}
		
		function hide(layerName) {
			document.getElementById(layerName).style.display = 'none';
		}
		
		function show_next(tab_name) {
			document.getElementById(last_tab).className = 'tab';
			var curr = document.getElementById(tab_name);
			curr.className='tab_hover';
			hide(last_tab+'_data');
			show(tab_name+'_data');
			last_tab=tab_name;
		}
	</script>
	
	<style>
		.tab {
			cursor:pointer;
			background:#ebebeb;
			color:#a2a2a2;
			font-weight:bold;
			border:1px solid #dadada;
			border-collapse:collapse;
		}
		.tab_hover {
			font-weight:bold;
			cursor:text;
			cursor:pointer;
			color:#000;
		}
		.tad_style {
			margin-top:10px;
			text-align:left;
			padding: 5px 10px;
		}
		.lift > div{
			float:left; text-align:center; padding:8px 10px; margin:-1px;
		}
		#tabing{
			padding:0px;
			margin-bottom:15px;
			position:relative;
			font-size:.9em;
			border:1px solid #dadada;
			border-collapse: collapse;
		}
	</style>
	
<div id="tabing"> 
    <div class="lift group">
        <div id="tab1" class="tab_hover" onclick="javascript:show_next('tab1')">Job by category</div>                                  
        <div id="tab4" class="tab"  onclick="javascript:show_next('tab4')">Job by location</div>  
    </div>
    <div id='tab1_data' class="tad_style">
    	<ul>  
	         <?php 
	         	$categories = $this->requestAction('job_categories/getAll');
	         	foreach($categories as $id => $name):
	         	echo '<li>'. $this->Html->link($name, '/job_details/search/'.$id.'/category') . '</li>';
	         	endforeach;
	         ?>
         </ul>
    </div>
                            
    <div id='tab4_data' class="tad_style" style='display:none'>
        <ul>  
	         <?php 
	         	$locations = $this->requestAction('job_locations/getAll');
	         	foreach($locations as $id => $name):
	         	echo '<li>'. $this->Html->link($name, '/job_details/search/'.$id . '/location') . '</li>';
	         	endforeach;
	         ?>
         </ul>
    </div>                            
</div>                      

<?php echo $this->element('latest');?>                        
<?php echo $this->element('news');?>
                        
                        
</div>